package com.sgb.kjwl.view.ui.adapter.self

import androidx.annotation.LayoutRes
import androidx.databinding.DataBindingUtil
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.sgb.businessmodule.entity.HomeBusinessListEntity
import com.sgb.kjwl.databinding.ItemSelfBusinessOpportunityBinding
import com.swgk.core.util.DateUtils


class SelfBusinessOpportunityAdapter(@LayoutRes layoutId : Int) : BaseQuickAdapter<HomeBusinessListEntity, BaseViewHolder>(layoutId){
    private var mItemBinding : ItemSelfBusinessOpportunityBinding ?= null
    override fun convert(helper: BaseViewHolder?, item: HomeBusinessListEntity?) {
        mItemBinding = DataBindingUtil.bind(helper!!.itemView)
        if (mItemBinding != null){
            mItemBinding!!.entity = item
            mItemBinding!!.tvType.text = item!!.firstCategoryName
            mItemBinding!!.tvTime.text = DateUtils.timestampTo13Date3(item.publishTime)
            mItemBinding!!.tvSecondType.text = item.typeName
        }
    }
}